package cn.yzfy.common.model.dto;

import cn.yzfy.common.base.dto.BaseDTO;
import cn.yzfy.common.enums.ResourcesTypeEnum;
import cn.yzfy.common.validate.ValidateNotChinese;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;


import java.io.Serial;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AddResourcesInputDTO extends BaseDTO {
  
  @Serial
  private static final long serialVersionUID = 4380271138282804417L;
  
  /**
   * 编码
   */
  @ValidateNotChinese.ValidateNotNullAndEmpty(message = "编码不能为空")
  @Schema(description = "资源编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "RoleMgt")
  private String code;
  
  /**
   * 资源名称
   */
  @ValidateNotChinese.ValidateNotNullAndEmpty(message = "资源名称不能为空")
  @Schema(description = "资源名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "角色管理")
  private String name;
  
  /**
   * 路由地址
   */
  @Schema(description = "路由地址", example = "/pms/role")
  private String path;
  
  /**
   * 组件路径
   */
  @Schema(description = "组件路径", example = "/src/views/pms/role/index.vue")
  private String component;
  
  /**
   * 描述
   */
  @Schema(description = "描述", example = "xx功能页面")
  private String description;
  
  /**
   * 菜单图标
   */
  @Schema(description = "菜单图标", example = "i-fe:user")
  private String icon;
  
  /**
   * 布局方式
   */
  @Schema(description = "布局方式")
  private String layout;
  
  /**
   * 是否显示
   */
  @Schema(description = "菜单图标", example = "true")
  private Boolean show;
  
  /**
   * 是否启用
   */
  @ValidateNotChinese.ValidateNotNullAndEmpty(message = "是否启用状态不能为空")
  @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
  private Boolean enable;
  
  /**
   * keepAlive 是否组件之间切换时缓存它们的状态
   */
  @Schema(description = "keepAlive是否组件之间切换时缓存它们的状态", example = "true")
  private Boolean keepAlive;
  
  /**
   * 资源类型
   */
  @ValidateNotChinese.ValidateNotNullAndEmpty(message = "资源类型不能为空")
  @Schema(description = "资源类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "MENU")
  private ResourcesTypeEnum type;
  
  /**
   * 排序
   */
  @Schema(description = "排序值越低越靠前", example = "1")
  private String order;
  
  /**
   * 上级资源id
   */
  @Schema(description = "所属菜单Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
  private String parentId;
}